package com.curlymaster.podcastalarmclock;
import java.io.File;
import java.util.Date;

import android.os.Environment;

// Not completed and in design !!!!!!!!!!!
public class SdManager {

	private final String pathToFolder = "/PodcastAlarm";
	private String xmlFilePath;
	private String mp3FilePath;
	
public	SdManager()
	{
		String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
		File newPathToFolder = new File(extStorageDirectory + pathToFolder);
		
		if(!newPathToFolder.exists())
		{
			newPathToFolder.mkdir();
		}
		
		setXmlFilePath();
		setMp3FilePath();
		// initialize members
		
	}

public String getXmlFilePath()
{
	return xmlFilePath;
}

public String getMp3FilePath()
{
	return mp3FilePath;
}

private void setXmlFilePath()
	{
		String presentTime = getTime();
		xmlFilePath = Environment.getExternalStorageDirectory()+pathToFolder+"/info_t"+ presentTime + ".xml";
	}

private void setMp3FilePath()
	{
		String presentTime = getTime();
	    mp3FilePath = Environment.getExternalStorageDirectory()+pathToFolder+"/podcast_t"+ presentTime +".mp3";
	}

private String getTime()
	{
		// TODO Auto-generated method stub
		Date date = new Date();
		int hours = date.getHours();
	    String time;
	    time = "_"+ hours ;	
	    time.trim();
	    return time;
	}
}
